#pragma once
#include <GRendererInfra\GRiBounds3Box.h>
#include "GRTXRay.h"
#include "GRTXObj.h"


class GRTXBVH
{
public:
	GRTXBVH() :left(nullptr), right(nullptr) {}
	HitInfo Intersect(const GRTXRay& ray) const;
	
	bool IsLeaf()const { return left == nullptr; }

public:
	std::vector<GSPtr<GRTXObject>> primitives;
	GRiBounds3Box box;
	GUPtr<GRTXBVH> left;
	GUPtr<GRTXBVH> right;
};

